800
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := 1/*SortAscending*/
		oGrid:EndUpdate()
		oGrid:BeginUpdate()
		oGrid:EnsureVisibleColumn(0)
		oItems := oGrid:Items()
			oItems:SetProperty("ExpandItem",oItems:FirstVisibleItem(),.F.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
799
Is there any public method to export the selected data

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumns := oGrid:Columns()
			oColumns:Add("C1")
			oColumns:Add("C2"):FormatColumn := "1 index `A-Z`"
			oColumns:Add("C3"):FormatColumn := "100 index ``"
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:SetProperty("SelectItem",oItems:AddItem("Item 2"),.T.)
			oItems:AddItem("Item 3")
		oGrid:EndUpdate()
		DevOut( "Export CSV Selected Items Only:" )
		DevOut( Transform(oGrid:Export("","sel"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
798
How do I enable the scrollbar-extension, as thumb to be shown outside of the control's client area

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ScrollBars := 15/*exDisableBoth*/
		oGrid:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oGrid:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oGrid:SetProperty("ScrollPartVisible",2/*0x2+*/,65536/*exExtentThumbPart*/,.T.)
		oGrid:ScrollWidth := 4
		oGrid:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oGrid:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oGrid:ScrollHeight := 4
		oGrid:SetProperty("Background",404/*exHSBack*/,oGrid:Background(276/*exVSBack*/))
		oGrid:SetProperty("Background",388/*exHSThumb*/,oGrid:Background(260/*exVSThumb*/))
		oGrid:SetProperty("Background",511/*exScrollSizeGrip*/,oGrid:Background(276/*exVSBack*/))
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
797
I need to format a Column with Currency Format, but we use we are using Dhirams (AED)for the Amount. How to do this

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:MarkSearchColumn := .F.
		oColumns := oGrid:Columns()
			oColumns:Add("Name")
			oColumn := oColumns:Add("Currency")
				oColumn:SortType := 1/*SortNumeric*/
				oColumn:AllowSizing := .F.
				oColumn:Width := 64
				oColumn:FormatColumn := "currency(value)"
			oColumn1 := oColumns:Add("Format")
				oColumn1:SortType := 1/*SortNumeric*/
				oColumn1:AllowSizing := .F.
				oColumn1:Width := 64
				oColumn1:FormatColumn := "`AED ` + (value format ``)"
		oItems := oGrid:Items()
			h := oItems:AddItem("Value 1")
			oItems:SetProperty("CellValue",h,1,10)
			oItems:SetProperty("CellValue",h,2,10)
			h := oItems:AddItem("Value 2")
			oItems:SetProperty("CellValue",h,1,20)
			oItems:SetProperty("CellValue",h,2,20)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
796
How can I have a case-insensitive filter (exFilterDoCaseSensitive flag is not set)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:MarkSearchColumn := .F.
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Car")
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterType := 240/*exFilter*/
				oColumn:Filter := "MAZDA"
			oColumn1 := oColumns:Add("Equipment")
				oColumn1:DisplayFilterButton := .T.
				oColumn1:DisplayFilterPattern := .F.
				oColumn1:CustomFilter := "Air Bag||*Air Bag*|||Air condition||*Air condition*|||ABS||*ABS*|||ESP||*ESP*"
				oColumn1:FilterType := 3/*exPattern*/
				oColumn1:Filter := "AIR BAG"
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag")
			oItems:SetProperty("CellValue",oItems:AddItem("Toyota"),1,"Air Bag,Air condition")
			oItems:SetProperty("CellValue",oItems:AddItem("Ford"),1,"Air condition")
			oItems:SetProperty("CellValue",oItems:AddItem("Nissan"),1,"Air Bag,ABS,ESP")
			oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag, ABS,ESP")
			oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"ABS,ESP")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
795
How can I have a case-sensitive filter

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:MarkSearchColumn := .F.
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Car")
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterType := 496/*exFilterDoCaseSensitive+exFilter*/
				oColumn:Filter := "Mazda"
			oColumn1 := oColumns:Add("Equipment")
				oColumn1:DisplayFilterButton := .T.
				oColumn1:DisplayFilterPattern := .F.
				oColumn1:CustomFilter := "Air Bag||*Air Bag*|||Air condition||*Air condition*|||ABS||*ABS*|||ESP||*ESP*"
				oColumn1:FilterType := 259/*exFilterDoCaseSensitive+exPattern*/
				oColumn1:Filter := "Air Bag"
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag")
			oItems:SetProperty("CellValue",oItems:AddItem("Toyota"),1,"Air Bag,Air condition")
			oItems:SetProperty("CellValue",oItems:AddItem("Ford"),1,"Air condition")
			oItems:SetProperty("CellValue",oItems:AddItem("Nissan"),1,"Air Bag,ABS,ESP")
			oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag, ABS,ESP")
			oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"ABS,ESP")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
794
How can I exclude an item from aggregate/total computation

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("Default"):SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oGrid:Items()
			oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
			h := oItems:LockedItem(0/*exTop*/,0)
			oItems:SetProperty("CellValue",h,0,"sum(all,rec,%0)")
			oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems:SetProperty("FormatCell",h,0,"`Sum: ` + (value format ``) ")
			oItems:AddItem(10)
			h := oItems:AddItem(20)
			oItems:SetProperty("SortableItem",h,.F.)
			oItems:SetProperty("FormatCell",h,0,"value + ` <fgcolor=808080> this item is excluded from aggregate computations</fgcolor>`")
			oItems:AddItem(30)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
793
Is is possible to change the default group header to display sum rather than count

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:HasLines := 0/*exNoLine*/
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SingleSort := .F.
		oGrid:SortBarVisible := .T.
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(6):AllowGroupBy := .F.
		oColumn := oGrid:Columns:Item(1)
			oColumn:GroupByFormatCell := "'<caption> (sum: <b>' + value + '</b>, of Freight)'"
			oColumn:GroupByTotalField := "sum(current,rec,%6)"
			oColumn:SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
792
How do I get the caption of the group during the AddGroupItem event

PROCEDURE OnAddGroupItem(oGrid,Item)
	LOCAL oItems
	oItems := oGrid:Items()
		DevOut( "Caption:" )
		DevOut( oItems:CellCaption(Item,oItems:GroupItem(Item)) )
		DevOut( "Value:" )
		DevOut( Transform(oItems:CellValue(Item,oItems:GroupItem(Item)),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:HasLines := 0/*exNoLine*/
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SingleSort := .F.
		oGrid:SortBarVisible := .T.
		oGrid:AllowGroupBy := .T.
		oColumn := oGrid:Columns:Item(1)
			oColumn:GroupByFormatCell := "'<b><caption></b> (' + value + ') group'"
			oColumn:SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
791
Is it possible, to add more aggregate functions to grouping header

PROCEDURE OnAddGroupItem(oGrid,Item)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:SetProperty("FormatCell",Item,oItems:GroupItem(Item),"value + ` Min: <b>` + %13 + `</b> Max: <b>` + %14 + `</b> Sum: <b>` + %15 + `</b>, of Freight column`")
		oItems:SetProperty("CellValue",Item,"Min","min(current,all,dbl(%6))")
		oItems:SetProperty("CellValueFormat",Item,"Min",4/*exTotalField*/)
		oItems:SetProperty("CellValue",Item,"Max","max(current,all,dbl(%6))")
		oItems:SetProperty("CellValueFormat",Item,"Max",4/*exTotalField*/)
		oItems:SetProperty("CellValue",Item,"Sum","sum(current,all,dbl(%6))")
		oItems:SetProperty("CellValueFormat",Item,"Sum",4/*exTotalField*/)
RETURN

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/
		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:HasLines := 0/*exNoLine*/
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SingleSort := .F.
		oGrid:SortBarVisible := .T.
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oColumns := oGrid:Columns()
			oColumns:Add("Min"):Visible := .F.
			oColumns:Add("Max"):Visible := .F.
			oColumns:Add("Sum"):Visible := .F.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
790
Is it possible to display more aggregate functions to a single cell (method 2)

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:SortOnClick := 0/*exNoSort*/
		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:Indent := 13
		oGrid:HeaderVisible := .F.
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumns := oGrid:Columns()
			oColumns:Add("Items")
			oColumns:Add("Quantity"):Editor():EditType := 4/*SpinType*/
			oColumns:Add("Sum"):Visible := .F.
			oColumns:Add("Min"):Visible := .F.
			oColumns:Add("Max"):Visible := .F.
		oItems := oGrid:Items()
			h := oItems:AddItem("Items")
			oItems:SetProperty("CellMerge",h,0,1)
			oItems:SetProperty("FormatCell",h,0,"`Items, <b>sum(` + %2 + `), min(` + %3 + `), max(` + %4 + `)</b>`")
			oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
			oItems:SetProperty("CellValue",h,2,"sum(current,dir,dbl(%1))")
			oItems:SetProperty("CellValueFormat",h,2,4/*exTotalField*/)
			oItems:SetProperty("CellValue",h,3,"min(current,dir,dbl(%1))")
			oItems:SetProperty("CellValueFormat",h,3,4/*exTotalField*/)
			oItems:SetProperty("CellValue",h,4,"max(current,dir,dbl(%1))")
			oItems:SetProperty("CellValueFormat",h,4,4/*exTotalField*/)
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Item 1"),1,10)
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Item 2"),1,20)
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Item 3"),1,30)
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
789
How can I use the current in the aggregate/total field

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:SortOnClick := 0/*exNoSort*/
		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:Indent := 13
		oGrid:HeaderVisible := .F.
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumns := oGrid:Columns()
			oColumns:Add("Items")
			oColumns:Add("Quantity"):Editor():EditType := 4/*SpinType*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Items")
			oItems:SetProperty("CellValue",h,1,"sum(current,dir,dbl(%1))")
			oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
			oItems:SetProperty("FormatCell",h,1,"`Total: `+ value")
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Item 1"),1,10)
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Item 2"),1,20)
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Item 3"),1,30)
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
788
How can I prevent a specified item to be not included in the aggregate/total function

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h,h1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:SortOnClick := 0/*exNoSort*/
		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:HasLines := 2/*exThinLine*/
		oGrid:HeaderVisible := .F.
		oGrid:Columns():Add("Numbers"):Editor():EditType := 4/*SpinType*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Numbers")
			oItems:SetProperty("CellEditorVisible",h,0,0/*exEditorHidden*/)
			oItems:SetProperty("ItemBold",oItems:InsertItem(h,,10),.T.)
			oItems:SetProperty("ItemBold",oItems:InsertItem(h,,20),.T.)
			oItems:SetProperty("ItemBold",oItems:InsertItem(h,,30),.T.)
			h1 := oItems:InsertItem(h,,"not included")
			oItems:SetProperty("CellEditorVisible",h1,0,0/*exEditorHidden*/)
			oItems:SetProperty("CellValueFormat",h1,0,1/*exHTML*/)
			oItems:SetProperty("CellHAlignment",h1,0,2/*RightAlignment*/)
			oItems:SetProperty("SortableItem",h1,.F.)
			h1 := oItems:InsertItem(0,,"sum(all,rec,dbl(%0))")
			oItems:SetProperty("ItemBold",h1,.T.)
			oItems:SetProperty("SelectableItem",h1,.F.)
			oItems:SetProperty("CellValueFormat",h1,0,5/*exTotalField+exHTML*/)
			oItems:SetProperty("FormatCell",h1,0,"`Sum: ` + value")
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
787
Is is possible to specify which items/cells/fields to be included by the aggregate/total function I am using

PROCEDURE OnAddItem(oGrid,Item)
	oGrid:Items():SetProperty("SortableItem",Item,.F.)
RETURN

PROCEDURE OnCellStateChanged(oGrid,Item,ColIndex)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:SetProperty("SortableItem",Item,.F.)
	oGrid:Refresh()
RETURN

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddItem := {|Item| OnAddItem(oGrid,Item)} /*Occurs after a new Item has been inserted to Items collection.*/
		oGrid:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oGrid,Item,ColIndex)} /*Fired after cell's state has been changed.*/
		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:TreeColumnIndex := -1
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:SortOnClick := 0/*exNoSort*/
		oGrid:Columns():Add("Check Numbers"):Editor():EditType := 4/*SpinType*/
		oItems := oGrid:Items()
			oItems:SetProperty("CellHasCheckBox",oItems:AddItem(10),0,.T.)
			h := oItems:AddItem(20)
			oItems:SetProperty("CellHasCheckBox",h,0,.T.)
			oItems:SetProperty("CellState",h,0,1)
			oItems:SetProperty("CellHasCheckBox",oItems:AddItem(30),0,.T.)
			h := oItems:AddItem("sum(all,rec,dbl(%0))")
			oItems:SetProperty("SelectableItem",h,.F.)
			oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems:SetProperty("FormatCell",h,0,"`sum on checked items : ` + value")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
786
Can I display multiple total/aggregate functions such as sum, min or max, into a single cell (method 1)

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:TreeColumnIndex := -1
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:Columns():Add("Numbers"):Editor():EditType := 4/*SpinType*/
		oItems := oGrid:Items()
			oItems:AddItem(10)
			oItems:AddItem(20)
			oItems:AddItem(30)
			h := oItems:AddItem("sum(all,rec,dbl(%0))")
			oItems:SetProperty("SelectableItem",h,.F.)
			oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems:SetProperty("FormatCell",h,0,"`sum: ` + value")
			h := oItems:SplitCell(h,0)
			oItems:SetProperty("CellValue",0,h,"min(all,rec,dbl(%0))")
			oItems:SetProperty("CellValueFormat",0,h,5/*exTotalField+exHTML*/)
			oItems:SetProperty("FormatCell",0,h,"`min: ` + value")
			h := oItems:SplitCell(0,h)
			oItems:SetProperty("CellValue",0,h,"max(all,rec,dbl(%0))")
			oItems:SetProperty("CellValueFormat",0,h,5/*exTotalField+exHTML*/)
			oItems:SetProperty("FormatCell",0,h,"`max: ` + value")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
785
How can I use the index of the item in total/aggregate functions, rather than root or parent

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:TreeColumnIndex := -1
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:Columns():Add("Numbers"):Editor():EditType := 4/*SpinType*/
		oColumn := oGrid:Columns():Add("Idx")
			oColumn:FormatColumn := "0 index ``"
			oColumn:Width := 24
			oColumn:AllowSizing := .F.
			oColumn:Enabled := .F.
		oItems := oGrid:Items()
			h := oItems:AddItem("3 Numbers")
			oItems:SetProperty("ItemHeight",h,0)
			oItems:SetProperty("SelectableItem",h,.F.)
			oItems:InsertItem(h,,10)
			oItems:InsertItem(h,,20)
			oItems:InsertItem(h,,30)
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("sum(0,dir,dbl(%0))")
			oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems:SetProperty("SelectableItem",h,.F.)
			oItems:SetProperty("FormatCell",h,0,"`sum of first three numbers is ` + value")
			h := oItems:AddItem("3 Numbers")
			oItems:SetProperty("ItemHeight",h,0)
			oItems:SetProperty("SelectableItem",h,.F.)
			oItems:InsertItem(h,,15)
			oItems:InsertItem(h,,35)
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("count(5,dir,dbl(%0))")
			oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems:SetProperty("SelectableItem",h,.F.)
			oItems:SetProperty("FormatCell",h,0,"`count of next two numbers is ` + value")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
784
How can I have a better view of what current, parent, all, dir or rec means in total/aggregate fields

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems,oItems1,oItems2,oItems3
	LOCAL h,h1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := 1/*exGroupLinesAtRoot*/
		oGrid:Columns():Add("Numbers"):Editor():EditType := 4/*SpinType*/
		oItems := oGrid:Items()
			h := oItems:AddItem("")
			oItems:SetProperty("CellValue",h,0,"sum(current,dir,dbl(%0))")
			oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems:SetProperty("FormatCell",h,0,"'sum of <fgcolor=FF0000><b>Direct</b> children: '+value + `</fgcolor> using <a>sum(current,dir,dbl(%0))`")
			oItems:SetProperty("ItemForeColor",oItems:InsertItem(h,,10),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemForeColor",oItems:InsertItem(h,,20),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemForeColor",oItems:InsertItem(h,,30),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ExpandItem",h,.T.)
		oItems1 := oGrid:Items()
			h := oItems1:AddItem("")
			oItems1:SetProperty("CellValue",h,0,"sum(current,rec,dbl(%0))")
			oItems1:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems1:SetProperty("FormatCell",h,0,"'sum of <fgcolor=00FF00><b>Leaf</b> chidlren: '+value +`</fgcolor> using <a>sum(current,rec,dbl(%0))`")
			oItems1:SetProperty("ItemForeColor",oItems1:InsertItem(oItems1:InsertItem(oItems1:InsertItem(oItems1:InsertItem(h,,100),,10),,10),,1),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			oItems1:SetProperty("ItemForeColor",oItems1:InsertItem(oItems1:InsertItem(h,,200),,2),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			oItems1:SetProperty("ItemForeColor",oItems1:InsertItem(oItems1:InsertItem(h,,300),,3),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			h1 := oItems1:InsertItem(h,,"sum(parent,direct,%0)")
			oItems1:SetProperty("CellValueFormat",h1,0,5/*exTotalField+exHTML*/)
			oItems1:SetProperty("FormatCell",h1,0,"'sum of <b>Parent Direct</b> children: '+value +`</fgcolor> using <a>sum(parent,direct,%0)`")
			h1 := oItems1:InsertItem(h,,"sum(parent,rec,%0)")
			oItems1:SetProperty("CellValueFormat",h1,0,5/*exTotalField+exHTML*/)
			oItems1:SetProperty("FormatCell",h1,0,"'sum of <fgcolor=00FF00><b>Parent Leaf</b> children: '+value +`</fgcolor> using <a>sum(parent,rec,%0)`")
			oItems1:SetProperty("ExpandItem",0,.T.)
		oItems2 := oGrid:Items()
			h := oItems2:AddItem("")
			oItems2:SetProperty("CellValue",h,0,"sum(all,rec,dbl(%0))")
			oItems2:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems2:SetProperty("FormatCell",h,0,"'sum of <fgcolor=FF00FF><b>All (leaf children)</b>: '+value  +`</fgcolor> using <a>sum(all,rec,dbl(%0))`")
		oItems3 := oGrid:Items()
			h := oItems3:AddItem("")
			oItems3:SetProperty("CellValue",h,0,"sum(all,all,dbl(%0))")
			oItems3:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
			oItems3:SetProperty("FormatCell",h,0,"'sum of <fgcolor=FF00FF><b>All (children)</b>: '+value  +`</fgcolor> using <a>sum(all,all,dbl(%0))`")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
783
Do you have any Fit-To-Page options when printing the control

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oPrint
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnAutoResize := .F.
		oGrid:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oPrint := CreateObject("Exontrol.Print")
			oPrint:Options := "FitToPage = On"
			oPrint:PrintExt := oGrid
			oPrint:Preview()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
782
How do I hide the selection

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:MarkSearchColumn := .F.
		oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
		oGrid:SetProperty("SelBackColor",oGrid:BackColor())
		oGrid:ShowFocusRect := .F.
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Format")
				oColumn:FormatColumn := "type(value) in (0,1) ? 'null' : ( dbl(value)<0 ? '<fgcolor=FF0000>'+ (value format '2|.|3|,|1' ) : (dbl(value)>0 ? '<fgcolor=0000FF>+'+(value format '2|.|3|,' ): '0.00') )"
				oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oGrid:Items()
			oItems:AddItem(10)
			oItems:AddItem(-8)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
781
How do I access the cells, or how do I get the values in the columns

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("C1")
			oColumns:Add("C2")
			oColumns:Add("C3")
		oItems := oGrid:Items()
			h := oItems:AddItem("Item 1")
			oItems:SetProperty("CellValue",h,1,"SubItem 1.1")
			oItems:SetProperty("CellValue",h,2,"SubItem 1.2")
			DevOut( Transform(oItems:CellValue(h,2),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
780
I am using the FormatColumn/FormatCell to format my columns. Is it possible to ignore the SelForeColor, so the foreground color for selected items does not override my settings

PROCEDURE OnSelectionChanged(oGrid)
	LOCAL oItems
	oItems := oGrid:Items()
		oItems:ClearItemBackColor(0)
		oItems:SetProperty("ItemBackColor",oItems:SelectedItem(0),AutomationTranslateColor( GraMakeRGBColor  ( { 128,255,255 } )  , .F. ))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:SelectionChanged := {|| OnSelectionChanged(oGrid)} /*Fired after a new item has been selected.*/

		oGrid:BeginUpdate()
		oGrid:MarkSearchColumn := .F.
		oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
		oGrid:SetProperty("SelBackColor",oGrid:BackColor())
		oGrid:ShowFocusRect := .F.
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Format")
				oColumn:FormatColumn := "type(value) in (0,1) ? 'null' : ( dbl(value)<0 ? '<fgcolor=FF0000>'+ (value format '2|.|3|,|1' ) : (dbl(value)>0 ? '<fgcolor=0000FF>+'+(value format '2|.|3|,' ): '0.00') )"
				oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oGrid:Items()
			oItems:AddItem(10)
			oItems:AddItem(-8)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
779
How can I get the number of columns being shown in the control's SortBar part

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SingleSort := .F.
		oGrid:SortBarVisible := .T.
		oGrid:Columns:Item(1):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:Columns:Item(2):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		DevOut( Transform(oGrid:Columns:SortBarColumnsCount(),"") )
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
778
How can I add a header and footer for grouping items

PROCEDURE OnAddGroupItem(oGrid,Item)
	LOCAL oItems
	LOCAL h
	oItems := oGrid:Items()
		h := oItems:InsertItem(Item,,"")
		oItems:SetProperty("SelectableItem",h,.F.)
		oItems:SetProperty("CellValue",h,6,"min(parent,rec,dbl(%6))")
		oItems:SetProperty("CellValueFormat",h,6,5/*exTotalField+exHTML*/)
		oItems:SetProperty("FormatCell",h,6,"`<font ;7><b>Min</b>: ` + value")
		oItems:SetProperty("ItemPosition",h,0)
		h := oItems:InsertItem(Item,,"")
		oItems:SetProperty("SelectableItem",h,.F.)
		oItems:SetProperty("CellValue",h,6,"max(parent,rec,dbl(%6))")
		oItems:SetProperty("CellValueFormat",h,6,5/*exTotalField+exHTML*/)
		oItems:SetProperty("FormatCell",h,6,"`<font ;7><b>Max</b>: ` + value")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:HasLines := 0/*exNoLine*/
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SingleSort := .F.
		oGrid:SortBarVisible := .T.
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
777
How can I add a footer for grouping items

PROCEDURE OnAddGroupItem(oGrid,Item)
	LOCAL oItems
	LOCAL h
	oItems := oGrid:Items()
		h := oItems:InsertItem(Item,,"")
		oItems:SetProperty("SelectableItem",h,.F.)
		oItems:SetProperty("CellValue",h,6,"sum(parent,rec,dbl(%6))")
		oItems:SetProperty("CellValueFormat",h,6,5/*exTotalField+exHTML*/)
		oItems:SetProperty("FormatCell",h,6,"`<font ;7><b>Sum</b>: ` + value")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:HasLines := 0/*exNoLine*/
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SingleSort := .F.
		oGrid:SortBarVisible := .T.
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
776
How can I handle the event for the inside controls

PROCEDURE OnItemOleEvent(oGrid,Item,Ev)
	DevOut( Transform(Ev,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oGrid1
	LOCAL oItems,oItems1,oItems2,oItems3
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ItemOleEvent := {|Item,Ev| OnItemOleEvent(oGrid,Item,Ev)} /*Fired when an ActiveX control hosted by an item has fired an event.*/

		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:ScrollBySingleLine := .T.
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:InsertControlItem(h,"Exontrol.Grid")
			oItems:SetProperty("ItemHeight",h,256)
			oGrid := oItems:ItemObject(h)
				oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
				oGrid:ScrollBySingleLine := .T.
				oGrid:Columns():Add("C1")
				oGrid:Columns():Add("C2")
				oItems1 := oGrid:Items()
					oItems1:SetProperty("CellValue",oItems1:AddItem(1),1,2)
				h := oGrid:Items:AddItem(3)
				oGrid:Items():SetProperty("CellValue",h,1,4)
				oItems2 := oGrid:Items()
					oItems2:SetProperty("ExpandItem",h,.T.)
					h := oItems2:InsertControlItem(h,"Exontrol.Grid")
					oGrid1 := oItems2:ItemObject(h)
						oGrid1:LinesAtRoot := -1/*exLinesAtRoot*/
						oGrid1:Columns():Add("Inside-Inside")
						oItems3 := oGrid1:Items()
							h := oItems3:AddItem("item")
							oItems3:InsertItem(h,,"child 1")
							oItems3:InsertItem(h,,"child 2")
							oItems3:InsertItem(h,,"child 3")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
775
How can I specify the position of the item manually (Method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			oItems:AddItem("Child 3")
			oItems:AddItem("Child 2")
			oItems:AddItem("Child 1")
			oItems:SetProperty("ItemPosition",oItems:ItemByIndex(0),2)
			oItems:SetProperty("ItemPosition",oItems:ItemByIndex(1),1)
			oItems:SetProperty("ItemPosition",oItems:ItemByIndex(2),0)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
774
How can I specify the position of the item manually (Method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h1,h2,h3

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h3 := oItems:AddItem("Child 3")
			h2 := oItems:AddItem("Child 2")
			h1 := oItems:AddItem("Child 1")
			oItems:SetProperty("ItemPosition",h3,2)
			oItems:SetProperty("ItemPosition",h2,1)
			oItems:SetProperty("ItemPosition",h1,0)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
773
Is it possible to open second inside grid in inside-grid

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oGrid1
	LOCAL oItems,oItems1,oItems2
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:ScrollBySingleLine := .T.
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:InsertControlItem(h,"Exontrol.Grid")
			oItems:SetProperty("ItemHeight",h,256)
			oGrid := oItems:ItemObject(h)
				oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
				oGrid:ScrollBySingleLine := .T.
				oGrid:Columns():Add("C1")
				oGrid:Columns():Add("C2")
				oItems1 := oGrid:Items()
					oItems1:SetProperty("CellValue",oItems1:AddItem(1),1,2)
				h := oGrid:Items:AddItem(3)
				oGrid:Items():SetProperty("CellValue",h,1,4)
				oItems2 := oGrid:Items()
					oItems2:SetProperty("ExpandItem",h,.T.)
					h := oItems2:InsertControlItem(h,"Exontrol.Grid")
					oGrid1 := oItems2:ItemObject(h)
						oGrid1:Columns():Add("Inside-Inside")
						oGrid1:Items():AddItem("item")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
772
Computed field concatating strings values to calculated values. Is there something we can change this

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("A")
			oColumns:Add("B")
			oColumns:Add("Sum"):ComputedField := "dbl(%0) + dbl(%1)"
			oColumns:Add("Concaternation"):ComputedField := "str(%0) + str(%1)"
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem(1),1,2)
			oItems:SetProperty("CellValue",oItems:AddItem(21),1,22)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
771
Is it possible the Items.FormatCell or Column.FormatColumn to use values from other columns

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumns := oGrid:Columns()
			oColumns:Add("A"):Editor():EditType := 4/*SpinType*/
			oColumns:Add("B"):FormatColumn := "currency(%0)"
			oColumns:Add("C"):FormatColumn := "%1 format ''"
		oItems := oGrid:Items()
			oItems:AddItem(1)
			oItems:AddItem(2)
			oItems:AddItem(3)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
770
Is it possible to do un-grouping the items

PROCEDURE OnClick(oGrid)
	oGrid:Ungroup()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Click := {|| OnClick(oGrid)} /*Occurs when the user presses and then releases the left mouse button over the grid control.*/

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarHeight := 24
		oGrid:HeaderHeight := 24
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:ReadOnly := -1/*exReadOnly*/
		oColumn := oGrid:Columns:Item(1)
			oColumn:Alignment := 1/*CenterAlignment*/
			oColumn:SetProperty("Def",4/*exCellBackColor*/,15790320)
			oColumn:SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
769
How can I change the visual aspect of the links in the sort bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarHeight := 24
		oGrid:HeaderHeight := 24
		oGrid:SetProperty("BackColorSortBar",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oGrid:SetProperty("BackColorSortBarCaption",oGrid:BackColor())
		oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAEGg4BdsIQAAYAQGKIYBkAKBQAGaAoDDgNw0QwAAxjMK0EwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQiiCYsS5GQBSFDcOwHGyQYDkCQpAAWL4tCyMc7QHKAWhrEAbJjgQYJUh+TQAAZCIJRXRQAL/K6rKwnSCQIgkUBpGKdBynEYoYxAfyESCJWyIahWAwoQjUMB1HLQAAxC5kKbkIxyBABFBdVjVeBYG78Bz+ABjEovbAMEwPBqAMwmIAZDheA4FR4AGhTXKcbxrFaXZSzKckPRoADSZq1Sg5LjDJI2ABqU6ABqNLZtJKsZS4apABrWeZ3Q7QMLdFTwA4PH6EZhxXAYbTVeaPZjQIBAgI")
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oColumn := oGrid:Columns:Item(1)
			oColumn:Alignment := 1/*CenterAlignment*/
			oColumn:SetProperty("Def",4/*exCellBackColor*/,15790320)
			oColumn:SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oColumn1 := oGrid:Columns:Item(5)
			oColumn1:Alignment := 1/*CenterAlignment*/
			oColumn1:SetProperty("Def",4/*exCellBackColor*/,16119285)
			oColumn1:SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:SetProperty("Background",28/*exSortBarLinkColor*/,0x1000000)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
768
Is it possible to display no +/- button for grouped items

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oColumn := oGrid:Columns:Item(1)
			oColumn:Alignment := 1/*CenterAlignment*/
			oColumn:SetProperty("Def",4/*exCellBackColor*/,15790320)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
767
How can I remove the extra information that grouped items display

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(6):AllowGroupBy := .F.
		oColumn := oGrid:Columns:Item(1)
			oColumn:GroupByTotalField := ""
			oColumn:GroupByFormatCell := ""
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
766
How can I change the label, caption or the formula of the grouped items

PROCEDURE OnAddItem(oGrid,Item)
	oGrid:Items():SetProperty("ItemDividerLineAlignment",Item,3/*DividerBoth*/)
RETURN

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	oGrid:Refresh()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddItem := {|Item| OnAddItem(oGrid,Item)} /*Occurs after a new Item has been inserted to Items collection.*/
		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oGrid:BeginUpdate()
		oGrid:ScrollBySingleLine := .T.
		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(6):AllowGroupBy := .F.
		oColumn := oGrid:Columns:Item(1)
			oColumn:GroupByTotalField := "sum(current,rec,%6)"
			oColumn:GroupByFormatCell := "'<font ;11>' + <caption> + '</font> <fgcolor=808080>( Freight: ' + currency(value) + ')'"
		oGrid:DefaultItemHeight := 28
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
765
How can I change the aspect of grouped items

PROCEDURE OnAddItem(oGrid,Item)
	LOCAL oItems
	LOCAL l
	oItems := oGrid:Items()
		oItems:SetProperty("ItemDividerLine",Item,0/*EmptyLine*/)
		l := oItems:GroupItem(Item)
		oItems:SetProperty("CellSingleLine",Item,l,0/*exCaptionWordWrap*/)
		oItems:SetProperty("CellBold",Item,l,.T.)
		oItems:SetProperty("CellBackColor",Item,l,0x1000000)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddItem := {|Item| OnAddItem(oGrid,Item)} /*Occurs after a new Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:ScrollBySingleLine := .T.
		oGrid:LinesAtRoot := 0/*exNoLinesAtRoot*/
		oGrid:TreeColumnIndex := -1
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAEGg4BKoCg6AADACAxRDAMgBQKAAzQFAYcBuGiGAAGMZhWgmFgAQhFcZQSKUOQTDKMIziaQIRDEMw5SSNIxyAK0QBkAqNQCkKKwIgmNYDSBMYABBIMBwiGQaRJnegYRDUMJCQjRVITVLMNoXDKZIyqEAHfpWVJWSLHcIhDBJUjcOYyTiOQrzCK8dB0G6bIrGEZpYRAPwEYDIIjbQhqFYDChCNLwHScEAxC4kLhnKK6Vb9d6HYhiOJYXhmDrfR7IMhyLI8QafFqXZhmOZZXizPY9T7QNB0LQ8eZbJqnahqOpaOx2W5dV7YNh2LTWGzXNq3bhuOzLbrme59X7gOB3RZeE4XRrHchxKq8XxnG6dZ7oOTUXofFOK5WmudQTh2LpfHOO5em+doSh4LwfhOS5mnGIw9D6LxfjOW5unSIQ+D8L4flOa5yD2fg/D+L5fnOe54ByigGAKAJgEgBBrgGYIICYCoCmCSAcGOA5hAgRgSgSYQBGo" +;
		"FoFmGCBmBqBphGESgegeYgIgYIoHkSKIWCaCZigiJgqgqYhog4LoLmGSJGDKBZhEiVg2gMY4ImYCIBGOSJ1n6D5kAeZZ2hCZBHj4RoRl6J4eEqEpeAkNhOHaXYJEYUh0GUSRVkwchlgkZZChaZZGnWOoXmYBpOGKGJamaLhmhmWhJiYahnlmSY2G4ZZZEmRhyGMZxJlWCBhFCFgWHaHpYkmSh+GSJp6AWG4amgRoOGeIZahmEoKGyJgKDWOIXGkBwGFmJJcHkWoWHQJQqGWVoTmmRx+EuJ5eFkIoiHuJBKhWdIQGqB52D2KpgDiaougMIxqyODJrEgbgvi2YgYjKOoumKSpij4FIrFsBg0iyLBKj6RoOmqSwmimMpkCqGpOiibQJCaII0mmWxWFCJotgoXpahWaRLHaEY3mWag6mKIpuEmFoIjmaBbiYbIgi6RhaH+O5Onmcpyh2VYAAEASAg")
		oGrid:DrawGridLines := 1/*exHLines*/
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oColumn := oGrid:Columns:Item(1)
			oColumn:GroupByFormatCell := "'EmployeeID: ' + <caption> + '<br><font ;7><fgcolor=808080>Count: ' + value"
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
764
How can I remove or change the line it shows for grouped items

PROCEDURE OnAddItem(oGrid,Item)
	oGrid:Items():SetProperty("ItemDividerLine",Item,0/*EmptyLine*/)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddItem := {|Item| OnAddItem(oGrid,Item)} /*Occurs after a new Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
763
Is it possible to determine whether an item is regular or a group by item
PROCEDURE OnMouseMove(oGrid,Button,Shift,X,Y)
	LOCAL h
	h := oGrid:ItemFromPoint(-1,-1,c,hit)
	DevOut( Transform(oGrid:Items:GroupItem(h),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oGrid,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
762
How can I collapse all items when the user performs a grouping

PROCEDURE OnAddGroupItem(oGrid,Item)
	oGrid:Items():SetProperty("ExpandItem",Item,.F.)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
761
Is it possible to select columns that user can drop to the sort bar, when using the Group By feature

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "<fgcolor=FF0000>Try to drag the EmployeeID column here."
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):AllowGroupBy := .F.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
760
How can I enable the Group By support, with no sort bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SingleSort := .F.
		oGrid:AllowGroupBy := .T.
		oGrid:Columns:Item(1):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
759
Does your control support Group-By feature

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:SortBarVisible := .T.
		oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
		oGrid:AllowGroupBy := .T.
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
758
How can I restrict a field to number only (Method 3, Float)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Numbers"):Editor()
			oEditor:EditType := 1/*EditType*/
			oEditor:Numeric := 1/*exFloat*/
		oGrid:Items():AddItem(12)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
757
How can I restrict a field to number only (Method 2, Integer only)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Numbers"):Editor()
			oEditor:EditType := 1/*EditType*/
			oEditor:Numeric := -1/*exInteger*/
		oGrid:Items():AddItem(12)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
756
How can I restrict a field to number only (Method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Numbers"):Editor()
			oEditor:EditType := 8/*MaskType*/
			oEditor:Mask := "###.###"
		oGrid:Items():AddItem(12)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
755
Is it possible to include only leaf items ( items with no childs ) in the drop down list

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 1315/*exShowFocusItem+exShowCheckBox+exSortItemsAsc+exLeafItems*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
754
I have several columns, but noticed that the filter is using AND between columns, but I need OR clause for filtering. Is it possible

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Item")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:Filter := "Child 1"
			oColumn:FilterType := 240/*exFilter*/
		oColumn1 := oGrid:Columns():Add("Date")
			oColumn1:DisplayFilterButton := .T.
			oColumn1:DisplayFilterPattern := .F.
			oColumn1:DisplayFilterDate := .T.
			oColumn1:FilterList := 9474/*exShowExclude+exShowFocusItem+exShowCheckBox+exNoItems*/
			oColumn1:Filter := Transform("12/28/2010","")
			oColumn1:FilterType := 4/*exDate*/
		oGrid:FilterCriteria := "%0 or %1"
		oGrid:SetProperty("Description",23/*exFilterBarOr*/,"<font ;18><fgcolor=FF0000>or</fgcolor></font>")
		oGrid:SetProperty("Description",11/*exFilterBarAnd*/,"<font ;18><fgcolor=FF0000>and</fgcolor></font>")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 1"),1,"12/27/2010")
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 2"),1,"12/28/2010")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 1"),1,"12/29/2010")
			oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 2"),1,"12/30/2010")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
753
Is it possible exclude the dates being selected in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Date")
			oColumn:SortType := 2/*SortDate*/
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:DisplayFilterDate := .T.
			oColumn:FilterList := 9474/*exShowExclude+exShowFocusItem+exShowCheckBox+exNoItems*/
		oItems := oGrid:Items()
			oItems:AddItem("12/27/2010")
			oItems:AddItem("12/28/2010")
			oItems:AddItem("12/29/2010")
			oItems:AddItem("12/30/2010")
			oItems:AddItem("12/31/2010")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
752
How can I display a calendar control inside the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Date")
			oColumn:SortType := 2/*SortDate*/
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:DisplayFilterDate := .T.
			oColumn:FilterList := 1282/*exShowFocusItem+exShowCheckBox+exNoItems*/
		oItems := oGrid:Items()
			oItems:AddItem("12/27/2010")
			oItems:AddItem("12/28/2010")
			oItems:AddItem("12/29/2010")
			oItems:AddItem("12/30/2010")
			oItems:AddItem("12/31/2010")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
751
Is it possible to include the dates as checkb-boxes in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Dates")
			oColumn:SortType := 2/*SortDate*/
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .T.
			oColumn:DisplayFilterDate := .T.
			oColumn:FilterList := 1280/*exShowFocusItem+exShowCheckBox*/
			oColumn:Filter := "to 12/27/2010"
			oColumn:FilterType := 4/*exDate*/
		oItems := oGrid:Items()
			oItems:AddItem("12/27/2010")
			oItems:AddItem("12/28/2010")
			oItems:AddItem("12/29/2010")
			oItems:AddItem("12/30/2010")
			oItems:AddItem("12/31/2010")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
750
How can I filter items for dates before a specified date

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Dates")
			oColumn:SortType := 2/*SortDate*/
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .T.
			oColumn:DisplayFilterDate := .T.
			oColumn:FilterList := 1026/*exShowFocusItem+exNoItems*/
			oColumn:Filter := "to 12/27/2010"
			oColumn:FilterType := 4/*exDate*/
		oItems := oGrid:Items()
			oItems:AddItem("12/27/2010")
			oItems:AddItem("12/28/2010")
			oItems:AddItem("12/29/2010")
			oItems:AddItem("12/30/2010")
			oItems:AddItem("12/31/2010")
		oGrid:ApplyFilter()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
749
Is it possible to filter dates

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oColumn := oGrid:Columns():Add("Dates")
			oColumn:SortType := 2/*SortDate*/
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .T.
			oColumn:DisplayFilterDate := .T.
			oColumn:FilterList := 1026/*exShowFocusItem+exNoItems*/
		oItems := oGrid:Items()
			oItems:AddItem("12/27/2010")
			oItems:AddItem("12/28/2010")
			oItems:AddItem("12/29/2010")
			oItems:AddItem("12/30/2010")
			oItems:AddItem("12/31/2010")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
748
Is it possible to change the Exclude field name to something different, in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:SetProperty("Description",25/*exFilterBarExclude*/,"Leaving out")
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
747
How can I display the Exclude field in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
746
Is it possible to show and ensure the focused item from the control, in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 1280/*exShowFocusItem+exShowCheckBox*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:SetProperty("SelectItem",oItems:InsertItem(h,,"Child 2"),.T.)
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
745
Is it possible to show only blanks items with no listed items from the control

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 16386/*exShowBlanks+exNoItems*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
744
How can I include the blanks items in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 16640/*exShowBlanks+exShowCheckBox*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
743
How can I select multiple items in the drop down filter window, using check-boxes

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 256/*exShowCheckBox*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
742
Is it possible to allow a single item being selected in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 128/*exSingleSel*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
741
How can I display no (All) item in the drop down filter window

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:SetProperty("Description",0/*exFilterBarAll*/,"")
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .T.
			oColumn:FilterList := 2/*exNoItems*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
740
Is it possible to display no items in the drop down filter window, so only the pattern is visible

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .T.
			oColumn:FilterList := 2/*exNoItems*/
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
739
How can I show the child items with no identation

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:Indent := 12
		oGrid:HasLines := 2/*exThinLine*/
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
738
Is there other ways of showing the hierarchy lines (exGroupLinesAtRoot)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := 1/*exGroupLinesAtRoot*/
		oGrid:Indent := 12
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
737
Is there other ways of showing the hierarchy lines (exGroupLinesOutside)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
		oGrid:Indent := 12
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
736
Is there other ways of showing the hierarchy lines (exGroupLinesInsideLeaf)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := 4/*exGroupLinesInsideLeaf*/
		oGrid:Indent := 12
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
735
Is there other ways of showing the hierarchy lines (exGroupLinesInside)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := 3/*exGroupLinesInside*/
		oGrid:Indent := 12
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
734
Is there other ways of showing the hierarchy lines (exGroupLines)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := 2/*exGroupLines*/
		oGrid:Indent := 12
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(oItems:InsertItem(h,,"Child 2"),,"SubChild 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
733
Is it possible to display a column with buttons when using exCRD format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1,oColumn2,oColumn3
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:DefaultItemHeight := 36
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Column1")
				oColumn:Visible := .F.
				oColumn:Editor():EditType := 1/*EditType*/
			oColumn1 := oColumns:Add("Column2")
				oColumn1:Visible := .F.
				oColumn1:Editor():EditType := 1/*EditType*/
			oColumn2 := oColumns:Add("Column3")
				oColumn2:Alignment := 1/*CenterAlignment*/
				oColumn2:HeaderAlignment := 1/*CenterAlignment*/
				oColumn2:Visible := .F.
				oColumn2:SetProperty("Def",2/*exCellHasButton*/,.T.)
				oColumn2:SetProperty("Def",3/*exCellButtonAutoWidth*/,.T.)
			oColumn3 := oColumns:Add("FormatLevel")
				oColumn3:FormatLevel := "(0/1),2:64"
				oColumn3:SetProperty("Def",32/*exCellFormatLevel*/,oColumn3:FormatLevel())
		oItems := oGrid:Items()
			h := oItems:AddItem("Cell 1.1")
			oItems:SetProperty("CellValue",h,1,"Cell 1.2")
			oItems:SetProperty("CellValue",h,2,"Cell 1.3")
			h := oItems:AddItem("Cell 2.1")
			oItems:SetProperty("CellValue",h,1,"Cell 2.2")
			oItems:SetProperty("CellValue",h,2,"Cell 2.3")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
732
How can I change the check-boxes appearance

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oAppearance
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oGrid:Columns():Add("Default")
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oColumn:PartialCheck := .T.
		oItems := oGrid:Items()
			h := oItems:AddItem("Root")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
		oAppearance := oGrid:VisualAppearance()
			oAppearance:Add(1,"XP:Button 3 12")
			oAppearance:Add(2,"XP:Button 3 11")
			oAppearance:Add(3,"XP:Button 3 10")
		oGrid:SetProperty("CheckImage",0/*Unchecked*/,16777216)
		oGrid:SetProperty("CheckImage",1/*Checked*/,33554432)
		oGrid:SetProperty("CheckImage",2/*PartialChecked*/,50331648)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
731
Is it possible to disable the cell's editor context menu
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("Edit"):Editor()
			oEditor:EditType := 1/*EditType*/
			oEditor:SetProperty("Option",202/*exEditAllowContextMenu*/,.F.)
		oItems := oGrid:Items()
			oItems:AddItem(10)
			oItems:AddItem(20)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
730
How can I find a value in a drop down editor

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("DropDownList"):Editor()
			oEditor:EditType := 3/*DropDownListType*/
			oEditor:AddItem(1,"DDList 1")
			oEditor:AddItem(2,"DDList 2")
			oEditor:AddItem(3,"DDList 3")
		oEditor1 := oGrid:Columns():Add("DropDown"):Editor()
			oEditor1:EditType := 2/*DropDownType*/
			oEditor1:AddItem(1,"DDType 1")
			oEditor1:AddItem(2,"DDType 2")
			oEditor1:AddItem(3,"DDType 3")
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",:AddItem(1),1,oGrid:Columns:Item(1):Editor():FindItem(1))
			oItems:SetProperty("CellValue",:AddItem(2),1,oGrid:Columns:Item(1):Editor():FindItem(2))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
729
What is the difference between DropDownType and DropDownListType

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oEditor,oEditor1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oEditor := oGrid:Columns():Add("DropDownList"):Editor()
			oEditor:EditType := 3/*DropDownListType*/
			oEditor:AddItem(1,"First item")
			oEditor:AddItem(2,"Second item")
			oEditor:AddItem(3,"Third item")
		oEditor1 := oGrid:Columns():Add("DropDown"):Editor()
			oEditor1:EditType := 2/*DropDownType*/
			oEditor1:AddItem(1,"First item")
			oEditor1:AddItem(2,"Second item")
			oEditor1:AddItem(3,"Third item")
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem(1),1,"Any")
			oItems:SetProperty("CellValue",oItems:AddItem(2),1,"Any")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
728
How can I add or change the padding (spaces) for captions in the control's header

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Padding-Left"):SetProperty("Def",52/*exHeaderPaddingLeft*/,18)
		oColumn := oGrid:Columns():Add("Padding-Right")
			oColumn:SetProperty("Def",53/*exHeaderPaddingRight*/,18)
			oColumn:HeaderAlignment := 2/*RightAlignment*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
727
Do you have any plans to add cell spacing and cell padding to the cells

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:DrawGridLines := -2/*exRowLines*/
		oColumn := oGrid:Columns():Add("Padding-Left")
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,18)
		oGrid:Columns():Add("No-Padding"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
		oGrid:Columns():Add("Empty"):Position := 0
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Item A.1"),1,"Item A.2")
			oItems:SetProperty("CellValue",oItems:AddItem("Item B.1"),1,"Item B.2")
			oItems:SetProperty("CellValue",oItems:AddItem("Item C.1"),1,"Item C.2")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
726
Is it possible to change the height for all items at once

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:Columns():Add("Items")
		oItems := oGrid:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",0,.T.)
		oGrid:EndUpdate()
		oGrid:DefaultItemHeight := 12
		oGrid:Items():SetProperty("ItemHeight",0,12)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
725
Can I display somehow the filter just on the top of the list, with an editor associated to each column

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	LOCAL oColumn
	DevOut( "Locked:" )
	DevOut( Transform(oGrid:Items:IsItemLocked(Item),"") )
	oColumn := oGrid:Columns:Item(ColIndex)
		oColumn:Filter := Transform(NewValue,"")
		oColumn:FilterType := 3/*exPattern*/
	oGrid:ApplyFilter()
RETURN

PROCEDURE OnMouseUp(oGrid,Button,Shift,X,Y)
	oGrid:Edit(oGrid:Items:LockedItem(0/*exTop*/,0))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/
		oGrid:MouseUp := {|Button,Shift,X,Y| OnMouseUp(oGrid,Button,Shift,X,Y)} /*Occurs when the user releases a mouse button.*/

		oGrid:ColumnAutoResize := .F.
		oGrid:ScrollBySingleLine := .T.
		oGrid:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oItems := oGrid:Items()
			oItems:SetProperty("LockedItemCount",0/*exTop*/,2)
			h := oItems:LockedItem(0/*exTop*/,0)
			oItems:CellEditor(h,0):EditType := 1/*EditType*/
			h := oItems:LockedItem(0/*exTop*/,1)
			oItems:SetProperty("ItemHeight",h,4)
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("SelectableItem",h,.F.)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
724
Is it possible to display information about the firing events
PROCEDURE OnEvent(oGrid,EventID)
	DevOut( Transform(oGrid:EventParam(-2),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Event := {|EventID| OnEvent(oGrid,EventID)} /*Notifies the application once the control fires an event.*/


	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
723
How can I change the layout of my columns when using the exCRD

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:DefaultItemHeight := 36
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Column1")
				oColumn:Visible := .F.
				oColumn:Editor():EditType := 1/*EditType*/
			oColumn1 := oColumns:Add("Column2")
				oColumn1:Visible := .F.
				oColumn1:Editor():EditType := 1/*EditType*/
			oColumns:Add("Column3"):Visible := .F.
			oColumn2 := oColumns:Add("FormatLevel")
				oColumn2:FormatLevel := "(0/1),2"
				oColumn2:SetProperty("Def",32/*exCellFormatLevel*/,oColumn2:FormatLevel())
		oItems := oGrid:Items()
			h := oItems:AddItem("Cell 1.1")
			oItems:SetProperty("CellValue",h,1,"Cell 1.2")
			oItems:SetProperty("CellValue",h,2,"Cell 1.3")
			h := oItems:AddItem("Cell 2.1")
			oItems:SetProperty("CellValue",h,1,"Cell 2.2")
			oItems:SetProperty("CellValue",h,2,"Cell 2.3")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
722
Is it possible to scroll the control's content by clicking and moving the mouse up or down

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		oGrid:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:AutoDrag := 16/*exAutoDragScroll*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
721
How can copy and paste the selection to Microsoft Word, any OLE compliant application, as a snapshot
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h,h1,h2,h3

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oGrid:SetProperty("HTMLPicture","p1","c:\exontrol\images\card.png")
		oGrid:SetProperty("HTMLPicture","p2","c:\exontrol\images\sun.png")
		oGrid:AutoDrag := 11/*exAutoDragCopySnapShot*/
		oGrid:LinesAtRoot := 0/*exNoLinesAtRoot*/
		oGrid:HasLines := 2/*exThinLine*/
		oGrid:ShowFocusRect := .F.
		oGrid:DefaultItemHeight := 26
		oGrid:Columns():Add("Task")
		oItems := oGrid:Items()
			h := oItems:AddItem("<img>p1:32</img>Group 1")
			oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("ItemBold",h,.T.)
			h1 := oItems:InsertItem(h,,"Task 1")
			h2 := oItems:InsertItem(h,,"Task 2")
			h3 := oItems:InsertItem(h,,"Task 3")
			h := oItems:AddItem("<img>p2:32</img>Group 2")
			oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
			oItems:SetProperty("ItemBold",h,.T.)
			oItems:SetProperty("ItemDivider",h,0)
			h1 := oItems:InsertItem(h,,"Task")
			oItems:SetProperty("ExpandItem",0,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
720
How can copy and paste the selection to Microsoft Word, any OLE compliant application, as a image

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h,var_HTMLPicture
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:SetProperty("HTMLPicture","p1","gCJKBOI4NBQaBQAhQNJJIIhShQAIERFQIA0RAYGLriiIEM5BJpBiIARYlMBNhQPLhJIhBKhoQLlTTLV4la5VYx/fZVOoee7de62drYdI4YIWcIteIQEbEEAzCghEwIRIZKSmJD8EIZMzARgZKYmEAmDISYgEAISIJKdg4JzSOK7bp9b73HiqezeNYxLD7Th7N67dpmQSQIZJUpzV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AaGYaIhwnBajQJECY6QkBCFwJwVI2A7ghYSOsOYrQmhDEyFUNogx9DUC8J4ZY6QIhtGeC8XQcRPAgEQH8W43QeACCwFIYQfgehIA8JoZIpBTDrFaH8Cy0ApC5EuB4Tg1BQBsB6DcY42hgCWGKGgcIkhJh1GmIQSozRqhuD0DwSYvQIjiBOHs" +;
		"YYlBVgOAoOMeQ/gjC/C2NAeYEQQ0pCQIkPoPhUC8HGAgY4QQMCjB0O8cwbAFB5GECnoYoh4gOCIL4NY0xOjbD3B4B1BUAmClAyAYDFDLDKDqDrB1BKD/BnAADtCOCxD1DLZnCEAAgZAABJBFBOBECuBCBgCCEBA==")
		var_HTMLPicture := oGrid:HTMLPicture("aka1")
		oGrid:HeaderHeight := 24
		oGrid:DefaultItemHeight := 48
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oGrid:SelBackMode := 1/*exTransparent*/
		oGrid:ColumnAutoResize := .F.
		oGrid:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:Columns:Item(0):SetProperty("Def",17/*exCellValueFormat*/,1)
		oGrid:Columns:Item(0):FormatColumn := "value + ` <img>p` + (1 + (value mod 3 ) ) + `</img>`"
		oGrid:Columns:Item(0):Width := 112
		oGrid:Columns:Item(1):SetProperty("Def",0/*exCellHasCheckBox*/,1)
		oGrid:Columns:Item(2):LevelKey := "1"
		oGrid:Columns:Item(3):LevelKey := "1"
		oGrid:Columns:Item(4):LevelKey := "1"
		oGrid:AutoDrag := 10/*exAutoDragCopyImage*/
		oGrid:SingleSel := .F.
		oItems := oGrid:Items()
			h := oItems:ItemByIndex(1)
			oItems:SetProperty("SelectItem",h,.T.)
			h := oItems:ItemByIndex(2)
			oItems:SetProperty("SelectItem",h,.T.)
			h := oItems:ItemByIndex(3)
			oItems:SetProperty("SelectItem",h,.T.)
			oItems:SetProperty("LockedItemCount",2/*exBottom*/,1)
			h := oItems:LockedItem(2/*exBottom*/,0)
			oItems:SetProperty("CellValue",h,1,"<font ;16>Click the selection and <b>wait to start dragging</b>, and then drop to Microsoft Word, ...")
			oItems:SetProperty("CellSingleLine",h,1,0/*exCaptionWordWrap*/)
			oItems:SetProperty("CellValueFormat",h,1,1/*exHTML*/)
			oItems:SetProperty("CellHAlignment",h,1,1/*CenterAlignment*/)
			oItems:SetProperty("ItemDivider",h,1)
			oItems:SetProperty("ItemDividerLineAlignment",h,2/*DividerTop*/)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
719
How can copy and paste the selection to Microsoft Word, Excel or any OLE compliant application, as a text

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:ColumnAutoResize := .F.
		oGrid:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oGrid:DataSource := rs
		oGrid:Columns:Item(2):LevelKey := "1"
		oGrid:Columns:Item(3):LevelKey := "1"
		oGrid:Columns:Item(4):LevelKey := "1"
		oGrid:AutoDrag := 9/*exAutoDragCopyText*/
		oGrid:SingleSel := .F.
		oItems := oGrid:Items()
			h := oItems:ItemByIndex(1)
			oItems:SetProperty("SelectItem",h,.T.)
			h := oItems:ItemByIndex(3)
			oItems:SetProperty("SelectItem",h,.T.)
			h := oItems:ItemByIndex(4)
			oItems:SetProperty("SelectItem",h,.T.)
			h := oItems:ItemByIndex(5)
			oItems:SetProperty("SelectItem",h,.T.)
			oItems:SetProperty("LockedItemCount",2/*exBottom*/,1)
			h := oItems:LockedItem(2/*exBottom*/,0)
			oItems:SetProperty("CellValue",h,0,"<font ;16>Click the selection and <b>wait to start dragging</b>, and then drop to Microsoft Word, Excel, ...")
			oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
			oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
			oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/)
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("ItemDividerLineAlignment",h,2/*DividerTop*/)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
718
Is it possible to change the indentation during the drag and drop

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h,h1,h2,h3

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oGrid:AutoDrag := 3/*exAutoDragPositionAny*/
		oGrid:LinesAtRoot := 0/*exNoLinesAtRoot*/
		oGrid:HasLines := 1/*exSolidLine*/
		oGrid:HasButtons := 3/*exWPlus*/
		oGrid:ShowFocusRect := .F.
		oGrid:SelBackMode := 1/*exTransparent*/
		oGrid:Columns():Add("Task")
		oItems := oGrid:Items()
			h := oItems:AddItem("Group 1")
			oItems:SetProperty("ItemBold",h,.T.)
			oItems:SetProperty("ItemDivider",h,0)
			h1 := oItems:InsertItem(h,,"Task 1")
			h2 := oItems:InsertItem(h1,,"Task 2")
			h2 := oItems:InsertItem(h1,,"Task 3")
			h3 := oItems:InsertItem(h,,"Task 3")
			oItems:SetProperty("ExpandItem",h,.T.)
			oItems:SetProperty("ExpandItem",h1,.T.)
			h := oItems:AddItem("Group 2")
			oItems:SetProperty("ItemBold",h,.T.)
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("LockedItemCount",2/*exBottom*/,1)
			h := oItems:LockedItem(2/*exBottom*/,0)
			oItems:SetProperty("CellValue",h,0,"Click a row, and move by dragging <b>up, down</b> to change the row's parent or <b>left,right</b> to increase or decrease the indentation.")
			oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
			oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
717
Is it possible to allow moving an item to another, but keeping its indentation

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h,h1,h2,h3

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oGrid:AutoDrag := 2/*exAutoDragPositionKeepIndent*/
		oGrid:LinesAtRoot := 0/*exNoLinesAtRoot*/
		oGrid:HasLines := 2/*exThinLine*/
		oGrid:ShowFocusRect := .F.
		oGrid:Columns():Add("Task")
		oItems := oGrid:Items()
			h := oItems:AddItem("Group 1")
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("ItemBold",h,.T.)
			h1 := oItems:InsertItem(h,,"Task 1")
			h2 := oItems:InsertItem(h,,"Task 2")
			h3 := oItems:InsertItem(h,,"Task 3")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Group 2")
			oItems:SetProperty("ItemBold",h,.T.)
			oItems:SetProperty("ItemDivider",h,0)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
716
How can I change the row's position to another, by drag and drop. Is it possible

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h1,h2,h3

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oGrid:AutoDrag := 1/*exAutoDragPosition*/
		oGrid:Columns():Add("Task")
		oItems := oGrid:Items()
			h1 := oItems:AddItem("Task 1")
			h2 := oItems:AddItem("Task 2")
			h3 := oItems:AddItem("Task 3")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
715
Is it possible background color displayed when the mouse passes over an item

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Def")
		oGrid:SetProperty("HotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,128 } )  , .F. ))
		oGrid:SetProperty("HotForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oItems := oGrid:Items()
			oItems:AddItem("Item A")
			oItems:AddItem("Item B")
			oItems:AddItem("Item C")
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
714
My development environment does not have any Object,GetOcx,DefaultDispatch,GetControlUnknown,nativeObject, ... property, is there any alternative I can pass the component to PrintExt so I can get printed

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Task")
		oItems := oGrid:Items()
			oItems:AddItem("Task 1")
			oItems:AddItem("Task 2")
		oGrid:EndUpdate()
		oGrid:Template := "Dim p;p = CreateObject(`Exontrol.Print`);p.PrintExt = Me;p.AutoRelease = False;p.Preview();"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
713
My development environment does not have any Object,GetOcx,DefaultDispatch,GetControlUnknown,nativeObject, ... property, is there any alternative I can pass the component to PrintExt so I can get printed

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oPrint
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Task 2")
		oGrid:EndUpdate()
		oPrint := CreateObject("Exontrol.Print")
			oPrint:PrintExt := oGrid:ExecuteTemplate("me")
			oPrint:Preview()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
712
How can I apply the same ConditionalFormat on more than 1(one) column (multiple columns and not on item)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oConditionalFormat,oConditionalFormat1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oConditionalFormat := oGrid:ConditionalFormats():Add("1","K1")
			oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oConditionalFormat:ApplyTo := 1/*0x1+*/
		oConditionalFormat1 := oGrid:ConditionalFormats():Add("1","K2")
			oConditionalFormat1:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oConditionalFormat1:ApplyTo := 2/*0x2+*/
		oGrid:MarkSearchColumn := .F.
		oGrid:DrawGridLines := -2/*exRowLines*/
		oColumns := oGrid:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2")
			oColumns:Add("Column 3")
		oItems := oGrid:Items()
			oItems:AddItem()
			oItems:AddItem()
			oItems:AddItem()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
711
Is it possible to add new records and see them in the control's view using the DataSource

PROCEDURE OnButtonClick(oGrid,Item,ColIndex,Key)
	LOCAL oRecordset
	oRecordset := oGrid:DataSource()
		oRecordset:AddNew("Task","New-Task")
		oRecordset:Update()
RETURN

PROCEDURE OnError(oGrid,Error,Description)
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems
	LOCAL h
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oGrid,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/
		oGrid:Error := {|Error,Description| OnError(oGrid,Error,Description)} /*Fired when an internal error occurs.*/

		rs := CreateObject("ADODB.Recordset")
			rs:Append("Task",8/*adBSTR*/)
			rs:Append("Start",7/*adDate*/)
			rs:Append("End",7/*adDate*/)
		rs:Open()
		oGrid:DrawGridLines := -2/*exRowLines*/
		oGrid:DetectAddNew := .T.
		oGrid:DetectDelete := .T.
		oGrid:DataSource := rs
		oItems := oGrid:Items()
			oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
			h := oItems:LockedItem(0/*exTop*/,0)
			oItems:SetProperty("ItemDivider",h,0)
			oItems:SetProperty("ItemHeight",h,22)
			oItems:SetProperty("CellValue",h,0,"AddNew")
			oItems:SetProperty("CellHasButton",h,0,.T.)
			oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
710
How can I initiate an OLE Drag and Drop operation in /COM version

PROCEDURE OnOLEStartDrag(oGrid,Data,AllowedEffects)
	/*Data.SetData("your data to drag")*/
	AllowedEffects := 2
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oGrid,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/

		oGrid:BeginUpdate()
		oGrid:Columns():Add("Default")
		oItems := oGrid:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")
			oItems:AddItem("Item 3")
			oItems:AddItem("Item 4")
			oItems:AddItem("Item 5")
		oGrid:OLEDropMode := 1/*exOLEDropManual*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
709
How can I find the order of the events
PROCEDURE OnAfterExpandItem(oGrid,Item)
	DevOut( "AfterExpandItem" )
	DevOut( Transform(Item,"") )
RETURN

PROCEDURE OnAnchorClick(oGrid,AnchorID,Options)
	DevOut( "AnchorClick" )
	DevOut( Transform(AnchorID,"") )
	DevOut( Transform(Options,"") )
RETURN

PROCEDURE OnBeforeExpandItem(oGrid,Item,Cancel)
	DevOut( "BeforeExpandItem" )
	DevOut( Transform(Item,"") )
RETURN

PROCEDURE OnButtonClick(oGrid,Item,ColIndex,Key)
	DevOut( "ButtonClick" )
	DevOut( Transform(Item,"") )
	DevOut( Transform(ColIndex,"") )
	DevOut( Transform(Key,"") )
RETURN

PROCEDURE OnCellImageClick(oGrid,Item,ColIndex)
	DevOut( "CellImageClick" )
	DevOut( Transform(Item,"") )
	DevOut( Transform(ColIndex,"") )
RETURN

PROCEDURE OnCellStateChanged(oGrid,Item,ColIndex)
	DevOut( "CellStateChanged" )
	DevOut( Transform(Item,"") )
	DevOut( Transform(ColIndex,"") )
RETURN

PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue)
	DevOut( "Change" )
	DevOut( Transform(Item,"") )
	DevOut( Transform(ColIndex,"") )
	DevOut( Transform(NewValue,"") )
RETURN

PROCEDURE OnClick(oGrid)
	DevOut( "Click" )
RETURN

PROCEDURE OnColumnClick(oGrid,Column)
	DevOut( "ColumnClick" )
RETURN

PROCEDURE OnDblClick(oGrid,Shift,X,Y)
	DevOut( "DblClick" )
	DevOut( Transform(Shift,"") )
	DevOut( Transform(X,"") )
	DevOut( Transform(Y,"") )
	oGrid:Edit()
RETURN

PROCEDURE OnEdit(oGrid,Item,ColIndex,Cancel)
	DevOut( "Edit" )
	DevOut( Transform(Item,"") )
	DevOut( Transform(ColIndex,"") )
RETURN

PROCEDURE OnEditClose(oGrid)
	DevOut( "EditClose" )
RETURN

PROCEDURE OnEditOpen(oGrid)
	DevOut( "EditOpen" )
RETURN

PROCEDURE OnFilterChange(oGrid)
	DevOut( "FilterChange" )
RETURN

PROCEDURE OnFilterChanging(oGrid)
	DevOut( "FilterChanging" )
RETURN

PROCEDURE OnFocusChanged(oGrid)
	DevOut( "FocusChanged" )
RETURN

PROCEDURE OnKeyDown(oGrid,KeyCode,Shift)
	DevOut( "KeyDown" )
	DevOut( Transform(KeyCode,"") )
	DevOut( Transform(Shift,"") )
RETURN

PROCEDURE OnKeyPress(oGrid,KeyAscii)
	DevOut( "KeyPress" )
	DevOut( Transform(KeyAscii,"") )
RETURN

PROCEDURE OnKeyUp(oGrid,KeyCode,Shift)
	DevOut( "KeyUp" )
	DevOut( Transform(KeyCode,"") )
	DevOut( Transform(Shift,"") )
RETURN

PROCEDURE OnLayoutChanged(oGrid)
	DevOut( "LayoutChanged" )
RETURN

PROCEDURE OnMouseDown(oGrid,Button,Shift,X,Y)
	DevOut( "MouseDown" )
	DevOut( Transform(Button,"") )
	DevOut( Transform(Shift,"") )
	DevOut( Transform(X,"") )
	DevOut( Transform(Y,"") )
RETURN

PROCEDURE OnMouseMove(oGrid,Button,Shift,X,Y)

RETURN

PROCEDURE OnMouseUp(oGrid,Button,Shift,X,Y)
	DevOut( "MouseUp" )
	DevOut( Transform(Button,"") )
	DevOut( Transform(Shift,"") )
	DevOut( Transform(X,"") )
	DevOut( Transform(Y,"") )
RETURN

PROCEDURE OnOffsetChanged(oGrid,Horizontal,NewVal)
	DevOut( "OffsetChanged" )
	DevOut( Transform(Horizontal,"") )
	DevOut( Transform(NewVal,"") )
RETURN

PROCEDURE OnOversizeChanged(oGrid,Horizontal,NewVal)
	DevOut( "OversizeChanged" )
	DevOut( Transform(Horizontal,"") )
	DevOut( Transform(NewVal,"") )
RETURN

PROCEDURE OnRClick(oGrid)
	DevOut( "RClick" )
RETURN

PROCEDURE OnScrollButtonClick(oGrid,ScrollBar,ScrollPart)
	DevOut( "ScrollButtonClick" )
	DevOut( Transform(ScrollBar,"") )
	DevOut( Transform(ScrollPart,"") )
RETURN

PROCEDURE OnSelectionChanged(oGrid)
	DevOut( "SelectionChanged" )
RETURN

PROCEDURE OnSort(oGrid)
	DevOut( "Sort" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn,oColumn1
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:AfterExpandItem := {|Item| OnAfterExpandItem(oGrid,Item)} /*Fired after an item is expanded (collapsed).*/
		oGrid:AnchorClick := {|AnchorID,Options| OnAnchorClick(oGrid,AnchorID,Options)} /*Occurs when an anchor element is clicked.*/
		oGrid:BeforeExpandItem := {|Item,Cancel| OnBeforeExpandItem(oGrid,Item,Cancel)} /*Fired before an item is about to be expanded (collapsed).*/
		oGrid:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oGrid,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/
		oGrid:CellImageClick := {|Item,ColIndex| OnCellImageClick(oGrid,Item,ColIndex)} /*Fired after the user clicks on the image's cell area.*/
		oGrid:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oGrid,Item,ColIndex)} /*Fired after cell's state has been changed.*/
		oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/
		oGrid:Click := {|| OnClick(oGrid)} /*Occurs when the user presses and then releases the left mouse button over the grid control.*/
		oGrid:ColumnClick := {|Column| OnColumnClick(oGrid,Column)} /*Fired after the user clicks on column's header.*/
		oGrid:DblClick := {|Shift,X,Y| OnDblClick(oGrid,Shift,X,Y)} /*Occurs when the user dblclk the left mouse button over an object.*/
		oGrid:Edit := {|Item,ColIndex,Cancel| OnEdit(oGrid,Item,ColIndex,Cancel)} /*Occurs just before editing the focused cell.*/
		oGrid:EditClose := {|| OnEditClose(oGrid)} /*Occurs when the edit operation ends.*/
		oGrid:EditOpen := {|| OnEditOpen(oGrid)} /*Occurs when the edit operation starts.*/
		oGrid:FilterChange := {|| OnFilterChange(oGrid)} /*Occurs when filter was changed.*/
		oGrid:FilterChanging := {|| OnFilterChanging(oGrid)} /*Notifies your application that the filter is about to change.*/
		oGrid:FocusChanged := {|| OnFocusChanged(oGrid)} /*Occurs when a new cell is focused.*/
		oGrid:KeyDown := {|KeyCode,Shift| OnKeyDown(oGrid,KeyCode,Shift)} /*Occurs when the user presses a key while an object has the focus.*/
		oGrid:KeyPress := {|KeyAscii| OnKeyPress(oGrid,KeyAscii)} /*Occurs when the user presses and releases an ANSI key.*/
		oGrid:KeyUp := {|KeyCode,Shift| OnKeyUp(oGrid,KeyCode,Shift)} /*Occurs when the user releases a key while an object has the focus.*/
		oGrid:LayoutChanged := {|| OnLayoutChanged(oGrid)} /*Occurs when column's position or column's size is changed.*/
		oGrid:MouseDown := {|Button,Shift,X,Y| OnMouseDown(oGrid,Button,Shift,X,Y)} /*Occurs when the user presses a mouse button.*/
		oGrid:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oGrid,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/
		oGrid:MouseUp := {|Button,Shift,X,Y| OnMouseUp(oGrid,Button,Shift,X,Y)} /*Occurs when the user releases a mouse button.*/
		oGrid:OffsetChanged := {|Horizontal,NewVal| OnOffsetChanged(oGrid,Horizontal,NewVal)} /*Occurs when the scroll position has been changed.*/
		oGrid:OversizeChanged := {|Horizontal,NewVal| OnOversizeChanged(oGrid,Horizontal,NewVal)} /*Occurs when the right range of the scroll has been changed.*/
		oGrid:RClick := {|| OnRClick(oGrid)} /*Fired when right mouse button is clicked*/
		oGrid:ScrollButtonClick := {|ScrollBar,ScrollPart| OnScrollButtonClick(oGrid,ScrollBar,ScrollPart)} /*Occurs when the user clicks a button in the scrollbar.*/
		oGrid:SelectionChanged := {|| OnSelectionChanged(oGrid)} /*Fired after a new item has been selected.*/
		oGrid:Sort := {|| OnSort(oGrid)} /*Fired when the control sorts a column.*/

		oGrid:BeginUpdate()
		oGrid:Images("gBJJgBAIEAAGAEGCAAhb/hz/EIAh8Tf5CJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1BAmBhOCwMGwuDw2ExWJxmIx2HyGLv+TlykUCgABmGYzzObzuczWcKujzOa0ug02hz+r1Wtz2qoCA2QAYG1yk02YA3NMy2Yh8Sh202zx4gA4jxADM5XG4vHACy6ESdjM6XUZiZTMS5bwZSm1c83+yQHCYHk81Q8O7qW18u/9NG3vAf/y83u4PQWQA0ZVADq/z6um6rkuw7TqH+5bYJu+z5vE8z2N02cGweoDfwfCrbQfBqkNzBb6QfDLxp6+LlOs5cSOTEzlm7FYACFFwADvGIAGvGjzOu7MbwHHECQSmUOvS8cGwk20gQc2ycQs4MLvL" +;
		"D8MNtDSfyS+cmyZJzywa96axzDsTw6/x1AAL8xRbF8Vm65jkH/AL8QFNTqR6lsfuDIb2uDKTzTo88FTtIk+PK3SNRDKiew5JVDSnK08NnOUGRClkt0PFEDUjMwAENS4AM2zj4udNznujT1PTgjdGQg8c71RPtESvCL1JrO8lozQUj1nP6d1TKtc0U8dS1jCaNRzGhrxnGthWJYdjUrYwc2ZMMx2NB8czZNk4VLPMstzXD6Q6mltVjPNAT0m1CvnDtBxBXlI3PRKNzZDtjQ6cd5TQ/TSU0/r/udC0A1Ez1SUja8/QhWVavrSLfpxWNzXZR2CygmVtXXVl03Lg+BV+lV3UjeDgzEL4AXkcb6Pje5LZNDzhuLfrOX/RtT0TQbc5lENSvBi2K5xlFdUHhN1ZhJ9F59WybOU7NjWTFkvxhGT9zIIQAWYHIABFqmnABSsT0HUaNYlI1dZmjNuUDRybzvIVWyDoOc54n8Oyxm9Ta9cSUaLbbg44+b4xiO9nY/pt" +;
		"73u38Tuc52tpdruYxDVyUbBV+gYpu2c7PyGMKTt21cjnW6OvzO8PppUvP/Ljlt/wt/Vvn+v8V1eCdbgaa7fnMi8vyD0TnzGEJXyp/wJ3js98iXe+F3/hwGM3jeQZjTeUznmOT5bTKJyqYcbm2c5bzXpqvsWw4FUkCO473wgB8cD9/znzO14n1+D4/efcTP4fl5+WKvxbbptmqV+B/ni/68R4514AvxeTAR50B3oPNei/iBhFgfErgeR4kBIiSAAJKSiC7PT5wMKIQ4fwfyHDzg2PwD4/B/jgg2PgA48AfjgB+RkeAARwAPGAA8jI4AADgAOMAAZGTyw6YbDkA7ZDaAHgxDyCxGgBw8EBBmJcS4LjAATDweBGoqjgAGP4jQ/AcjwAHBsiQex8gPH+MF7pDxxkB")
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
		oGrid:GridLineStyle := 4/*exGridLinesHDash*/
		oGrid:AutoEdit := .F.
		oGrid:ExpandOnDblClick := .F.
		oColumns := oGrid:Columns()
			oColumn := oColumns:Add("Column")
				oColumn:DisplayFilterButton := .T.
				oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
				oColumn:Editor():EditType := 1/*EditType*/
			oColumn1 := oColumns:Add("Button")
				oColumn1:AllowSizing := .F.
				oColumn1:Width := 18
				oColumn1:SetProperty("Def",2/*exCellHasButton*/,.T.)
		oItems := oGrid:Items()
			h := oItems:AddItem("parent")
			oItems:SetProperty("CellImage",h,0,1)
			oItems:InsertItem(h,"","child")
			oItems:SetProperty("ExpandItem",h,.T.)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
708
Is it possible to select a column instead sorting it

PROCEDURE OnColumnClick(oGrid,Column)
	/*Column.Selected = True*/
	oGrid:BeginUpdate()
	oGrid:Columns:Item(0):Selected := .F.
	oGrid:Columns:Item(1):Selected := .F.
	oGrid:Items():SelectAll()
	oGrid:EndUpdate()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:ColumnClick := {|Column| OnColumnClick(oGrid,Column)} /*Fired after the user clicks on column's header.*/

		oGrid:BeginUpdate()
		oGrid:MarkSearchColumn := .F.
		oGrid:ShowFocusRect := .F.
		oGrid:SingleSel := .F.
		oGrid:FullRowSelect := 1/*exRectSel*/
		oGrid:SortOnClick := 0/*exNoSort*/
		oColumns := oGrid:Columns()
			oColumns:Add("Column1")
			oColumns:Add("Column2")
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("One"),1,"Three")
			oItems:SetProperty("CellValue",oItems:AddItem("Two"),1,"Four")
			oItems:SelectAll()
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
707
Is it possible to display empty strings for 0 values

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumn := oGrid:Columns():Add("Currency")
			oColumn:FormatColumn := "dbl(value) ? currency(dbl(value)) : ``"
			oEditor := oColumn:Editor()
				oEditor:EditType := 1/*EditType*/
				oEditor:Numeric := 1/*exFloat*/
		oItems := oGrid:Items()
			oItems:AddItem(1.23)
			oItems:AddItem(2.34)
			oItems:AddItem(0)
			oItems:AddItem(10000.99)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
706
Is it possible to display empty strings for 0 values

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:Columns():Add("Number")
		oGrid:Columns():Add("Currency"):ComputedField := "%0 ? currency(%0) : ``"
		oItems := oGrid:Items()
			oItems:AddItem(1.23)
			oItems:AddItem(2.34)
			oItems:AddItem(0)
			oItems:AddItem(10000.99)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
705
How can I get the list of items as they are displayed

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oGrid:Columns():Add("Names")
		oItems := oGrid:Items()
			oItems:AddItem("Mantel")
			oItems:AddItem("Mechanik")
			oItems:AddItem("Motor")
			oItems:AddItem("Murks")
			oItems:AddItem("Märchen")
			oItems:AddItem("Möhren")
			oItems:AddItem("Mühle")
		oGrid:Columns:Item(0):SortOrder := 1/*SortAscending*/
		oGrid:EndUpdate()
		DevOut( Transform(oGrid:GetItems(1),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
704
Is it possible to add new rows, as I type like in Excel

PROCEDURE OnEditClose(oGrid)
	oGrid:Items():AddItem("")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:EditClose := {|| OnEditClose(oGrid)} /*Occurs when the edit operation ends.*/

		oGrid:BeginUpdate()
		oGrid:AutoEdit := .T.
		oGrid:Columns():Add("Default"):Editor():EditType := 1/*EditType*/
		oGrid:FullRowSelect := 0/*exColumnSel*/
		oGrid:Items():AddItem("")
		oGrid:DrawGridLines := -1/*exAllLines*/
		oGrid:ScrollBars := 15/*exDisableBoth*/
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
703
Is posible to reduce the size of the picture to be shown in the column's caption

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oGrid:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif")
		oGrid:HeaderHeight := 48
		oGrid:Columns():Add("DefaultSize"):HTMLCaption := "Default-Size <img>pic1</img> Picture"
		oGrid:Columns():Add("CustomSize"):HTMLCaption := "Custom-Size <img>pic1:16</img> Picture"
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
702
How can I change the color, font, bold etc for the items/cells in the same column or for the entire column

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oConditionalFormat
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oGrid:BeginUpdate()
		oConditionalFormat := oGrid:ConditionalFormats():Add("1")
			oConditionalFormat:Bold := .T.
			oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oConditionalFormat:ApplyTo := 1/*0x1+*/
		oGrid:Columns():Add("C1")
		oColumn := oGrid:Columns():Add("C2")
			oColumn:HeaderBold := .T.
			oColumn:HTMLCaption := "<fgcolor=FF0000>C2"
		oItems := oGrid:Items()
			oItems:SetProperty("CellValue",oItems:AddItem(10),1,11)
			oItems:SetProperty("CellValue",oItems:AddItem(12),1,13)
		oGrid:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
701
How can I filter the check-boxes (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGrid
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGrid := XbpActiveXControl():new( oForm:drawingArea )
	oGrid:CLSID  := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
	oGrid:create(,, {10,60},{610,370} )

		oColumn := oGrid:Columns():Add("Check")
			oEditor := oColumn:Editor()
				oEditor:EditType := 19/*CheckValueType*/
				oEditor:SetProperty("Option",17/*exCheckValue2*/,1)
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:CustomFilter := "checked||-1|||unchecked||0"
		oItems := oGrid:Items()
			oItems:AddItem(.T.)
			oItems:AddItem(.T.)
			oItems:AddItem(.F.)
			oItems:AddItem(.T.)
			oItems:AddItem(.F.)
			oItems:AddItem(.T.)
			oItems:AddItem(.F.)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN